package com.example.everying.service.chat;

import com.baomidou.mybatisplus.extension.service.IService;
import com.example.everying.model.dto.chat.ConversationDto;
import com.example.everying.model.entity.chat.ChatConversationEntity;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

public interface ChatConversationService extends IService<ChatConversationEntity> {

    ChatConversationEntity getConversation(String userId, String toUserId);

    void updateLastMessageId(String conversationId, String id,  String userId);

    List<ConversationDto> getUserConversations(String userId);

    @Transactional
    boolean deleteConversation(String userId, Long conversationId);

    List<ConversationDto> getUserConversationsByRedDot(String userId);

    boolean pinConversation(String conversationId, boolean isPinned, String userId);

    boolean isLastMessage(String conversationId, String messageId);

    void updateRecallMessageId(String conversationId);

    void checkConversationByTransfer(String fromUserId, String toUserId);
}
